<?php /* Smarty version 2.6.20, created on 2016-04-13 13:59:56
         compiled from app_version.htm */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>APP版本列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<style>
.table tbody th{
	text-align:left;
}
.table tbody td{
	text-align:left;
}
</style>
<script>
$(function(){
	$("#show_rule_box").click(function(){
		var __this =$(this);
		__this.after("<input type='text' style='width:200px;' name='update_rule_in'><span style='color:red'>(格式例如：nowVersion<2.0)</span>");
		$("#hide_rule_select").remove();
		__this.attr('disabled','disabled');
	});
});

</script>
</head>
<body>
<div class="container">
	<?php if ($_GET['act'] == 'add' || $_GET['act'] == 'edit'): ?>
		<div class="flow">
	        <div class="itemtitle">
	            <h3><?php if ($_GET['act'] == 'add'): ?>添加<?php else: ?>编辑<?php endif; ?></h3>
	            <ul>
                    <li><a href="?m=global&s=app_version.php"><span>版本列表</span></a></li>
                </ul>
	        </div>
	    </div>
	    <div class="h35"></div>
	    
	    <form action="" method="post">
	    	<input type="hidden" name="act" value="save">
	    	<?php if ($_GET['act'] == 'edit'): ?>
	    		<input type="hidden" name="editid" value="<?php echo $_GET['id']; ?>
">
	    	<?php endif; ?>
			<table width="100%" border="0" cellspacing="1" cellpadding="0">
				<tr>
			      <td width="30" height="50">版本编号:</td>
			      <td width="310" ><input class="text" type="text" name="version" value="<?php echo $this->_tpl_vars['de']['version_info']['version']; ?>
"></td>
			    </tr>
			    <tr>
			      <td width="30" height="50">系统类型:</td>
			      <td width="310" >
			      	<select name="client_system">
			      		<option value="1" <?php if ($this->_tpl_vars['de']['version_info']['client_system'] == '1'): ?> selected <?php endif; ?>>IOS</option>
			      		<option value="2" <?php if ($this->_tpl_vars['de']['version_info']['client_system'] == '2'): ?> selected <?php endif; ?>>Android</option>
			      	</select>
			      </td>
			    </tr>
			    <tr>
			      <td width="30" height="50">下载地址:</td>
			      <td width="510" ><input style="width:506px;" class="text" type="text" name="download_url" value="<?php echo $this->_tpl_vars['de']['version_info']['download_url']; ?>
"></td>
			    </tr>
			    <tr>
			      <td width="40" height="100">强制更新条件:</td>
			      <td width="500" >
			      		<div id="hide_rule_select" style="display:inline-block;">
				      		版本低于<select name="update_rule_se">
				      			<option value="">--请选择--</option>
				      			<?php $_from = $this->_tpl_vars['de']['versions']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['version']):
?>
				      				<option value="<?php echo $this->_tpl_vars['version']['version']; ?>
"><?php echo $this->_tpl_vars['version']['version']; ?>
</option>
				      			<?php endforeach; endif; unset($_from); ?>
				      		</select>
			      		</div>
			      		<input type="button" id="show_rule_box" value="高级" />
			      </td>
			    </tr>
			    <tr>
			      <td width="30" height="100">版本描述:</td>
			      <td width="500" ><textarea name="description" style="width:500px;height:100px;"><?php echo $this->_tpl_vars['de']['version_info']['description']; ?>
</textarea></td>
			    </tr>
			    <tr>
			      <td width="30" height="50"></td>
			      <td width="310" ><input class="btn" type="submit" name="submit" value="提交"></td>
			    </tr>
		  	</table>
  		</form>
	<?php else: ?>
	    <div class="flow">
	        <div class="itemtitle">
	            <h3>版本列表</h3>
	            <ul>
                    <li><a href="?m=global&s=app_version.php&act=add"><span>添加</span></a></li>
                </ul>
	        </div>
	    </div>
	    
	    <div class="h35"></div>
	    
	    <form action="" method="get">
	    <input type="hidden" name="m" value="global">
	    <input type="hidden" name="s" value="app_version.php">
	    <table class="select_table">
	        <tbody>
	            <tr>
					<td width="60">系统类型:</td>
	                <td width="30">
	                	<select name="client_system">
	                		<option value="">全部</option>
                			<option value="1" <?php if ($_GET['client_system'] == '1'): ?> selected <?php endif; ?> >IOS</option>
                			<option value="2" <?php if ($_GET['client_system'] == '2'): ?> selected <?php endif; ?> >Android</option>
	                	</select>
	                </td>
	                <input type="hidden" id="order" name="" value="" />
	                <td><input id="search" type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
	            </tr>
	            
	        </tbody>
	    </table>
	    </form>
	
		<form action="" name="snsform" method="get">
		<input type="hidden" name="m" value="global">
	    <input type="hidden" name="s" value="app_version.php">
	    <table class="table product">
	        <tbody>
	            <tr class="header">
	                <th width="50">ID</th>
	                <th width="100">版本号</th>
	                <th width="100">系统类型</th>
	                <th width="80">下载地址</th>
	                <th width="100">版本描述</th>
	                <th width="50">强制更新条件</th>
	                <th width="50"><a href="javascript:doorder('ctimeorder','<?php if ($_GET['ctimeorder'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">发布时间</a></th>
	                <th width="100">操作</th>
	            </tr>
	            <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
	            <tr>
	                <td><?php echo $this->_tpl_vars['list']['id']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['version']; ?>
</td>
	                <td><?php if ($this->_tpl_vars['list']['client_system'] == '1'): ?>IOS<?php else: ?>Android<?php endif; ?></td>
	                <td style="word-break: break-all;"><?php echo $this->_tpl_vars['list']['download_url']; ?>
</td>
	                <td title="<?php echo $this->_tpl_vars['list']['description']; ?>
" style="display:block;width:150px;height:30px;line-height:19px;overflow:hidden;" alt="<$list.description>"><?php echo $this->_tpl_vars['list']['description']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['must_updated_rule']; ?>
</td>
	                <td><?php echo $this->_tpl_vars['list']['create_time']; ?>
</td>
	                <td>
                		<a href="?m=global&s=app_version.php&act=edit&id=<?php echo $this->_tpl_vars['list']['id']; ?>
"><input type="button" value="编辑" /></a><br /><br />
	                </td>
	            </tr>
	            <?php endforeach; else: ?>
	            <tr>
	                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
	            </tr>
	            <?php endif; unset($_from); ?>
	        </tbody>
	        <tfoot>
	            <tr>
	                <td colspan="99">
	                	<div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
<?php if ($this->_tpl_vars['countpro']): ?></div>共有<?php echo $this->_tpl_vars['countpro']; ?>
条记录<?php endif; ?>
	                </td>
	            </tr>
	        </tfoot>
	    </table>
	    </form>
    <?php endif; ?>
</div>
</body>
<script>
//排序
function doorder(key,value){
	var order = $('#order');
	order.attr('name',key);
	order.attr('value',value);
	
	$('#search').trigger('click');
}
</script>
</html>